import _ from 'lodash'

export function shuffle(items) {
  return _.shuffle(items)
}

export function createRand(max) {
  return ~~(Math.random() * max)
}

export function getIdByKey(id, arr) {
  let res = -1
  arr.map((a, i) => {
    if (a.id == id) {
      res = i
    }
  })
  return res
}
